<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src='https://unpkg.com/@antv/l7'></script>
    <script src="https://lib.baomitu.com/jquery/2.2.4/jquery.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0
        }

        #map {
            width: 100vw;
            height: 100vh;
        }

        html,
        body {
            overflow: hidden;
        }
    </style>
</head>

<body>
    <div id="map">

    </div>
    <script>
        var { Scene, GaodeMap } = L7;
        const scene = new Scene({
            id: 'map',
            map: new GaodeMap({
                /* dark|light|normal */
                style: 'dark', // 样式URL
                center: [114.30, 30.50],
                pitch: 50,
                zoom: 6
            }),
            logoVisible: false
        });
        var data = {
            type: "FeatureCollection",
            features: [
                {
                    type: "Feature",
                    geometry: {
                        type: "Point",
                        coordinates: [114.30, 30.50]
                    },
                    properties: {
                        /* red */
                        radius: 20
                    }
                },
                {
                    type: "Feature",
                    geometry: {
                        type: "Point",
                        coordinates: [115.30, 30.50]
                    },
                    properties: {
                        /* green */
                        radius: 40
                    }
                }
            ]
        }
        /* PointLayer */
        scene.on("loaded", () => {
            var pointLayer = new L7.PointLayer({

            })
            pointLayer.source(data)
                .color("radius", r => {
                    if (r == 40) {
                        return "green"
                    } else if (r == 20) {
                        return "red"
                    }
                })
                .size("radius", r => {
                    console.log(r)
                    return r / 2;
                })
                /* 设置形状 */
                .shape("simple")
                .style({
                    opacity: 0.4,
                    // strokeWidth: 10,
                    // stroke: "#652e80"
                })
            scene.addLayer(pointLayer)
        })
    </script>
</body>

</html>